def hello(name):
    print("hello world!" + name)


hello("gang")


def test(name, age=60):
    print(name, age)


test(name=40, age=40)
test(40, 40)
test(30)


def test1(arg1, *arg):  # 可看成扩展运算符
    print(arg1)
    print(arg)  # 元祖的形式呈现


test1(1, 2, 3, 4, 5)


def printinfo(arg1, **vardict):  # **字典形式传入
    "打印任何传入的参数"
    print("输出: ")
    print(arg1)
    print(vardict)


printinfo(1, a=2, b=3)


def f(a, b, *, c): # 单独*号存在
    print(a + b + c)


f(1, 2, c = 3)


# 匿名函数：函数体一般比较简单（不要格式化代码）
x = lambda a : a + 10
print(x(5))